 
: Xmk

 ,    ,      OGSM CS

     (AMK Mod):
config/misc/items.ltx
config/text/rus/string_table_enc_equipment.xml
scripts/amk.script
script/amk_mod.script

:


: 
1.   __.script   gamedata/scripts    :


snd = sound_object([[ambient\underground\rnd_giant]])

--    .   6  
function test_for_need_kur()
    amk.save_variable("kur",amk.load_variable("kur",0)+1)
    amk.g_start_timer("kur",0,0,6)
    kur_reduce_health()
end

--  ,    
function kur_reduce_health()
    local tmp = amk.load_variable("kur",0)
    if tmp > 150 then
        if db.actor.health > 0.15 then
            db.actor.health = - 0.15
        end
        if not snd:playing() then
            snd:play_at_pos(db.actor, vector():set(0,0,0), 0, sound_object.s2d)
        end
    end
end

-- 
function kur_item(oid, time)
    if alife():object(oid)==nil then
        local tmp = amk.load_variable("kur",0) - time*10
        if tmp < 0 then tmp = 0 end
        amk.save_variable("kur", tmp)
        kur_reduce_health()
    end
end




2.   amk.script:

:
function __do_timer_action(select_string,params_string)

:
if select_string=="kur" then
__.test_for_need_kur()
end



3.   amk_mod.script

  first_run :
amk.g_start_timer("kur",0,0,6)

   check_sleep_item(obj) 

    elseif section=="treasure_item" then
        stype="tr_item"

  end :

  elseif section == "sigaret" then
    stype = "sgr"




4.   items.ltx

  :


[sigaret]:identity_immunities
GroupControlSection  = spawn_group
discovery_dependency =
$spawn               = "food and drugs\antirad"
$prefetch            = 32
class                = II_ANTIR
cform                = skeleton
visual               = weapons\sigaret\sigaret.ogf

inv_name             = sigareta
inv_name_short       = sigareta
description          = enc_food_sigareta

inv_weight           = 0.02
inv_grid_width       = 1
inv_grid_height      = 2
inv_grid_x           = 10
inv_grid_y           = 24

cost                 = 50

; eatable item
eat_health           = 0
eat_satiety          = 0
eat_power            = 0
eat_radiation        = 0
eat_alcohol          = 0
wounds_heal_perc     = 0
eat_portions_num     = 1

; food item
animation_slot       = 4

;hud item
hud                  = wpn_vodka_hud



5.   string_table_enc_equipment.xml


<string id="sigareta">
    <text></text>
</string>
<string id="enc_food_sigareta">
    <text>   ,        </text>
</string>



    ...